/**
 * Copyright (C), 2021, 因特驰
 * FileName: FileimgController
 * Author:   李晋武
 * Date:     2021/7/15 23:56
 * Description:
 * History:
 * 李晋武          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.esc.controller;

import com.esc.util.FileUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

/**
 * 〈文件控制层〉<br>
 * 〈〉
 *
 * @author Yun
 * @create 2021/7/15
 * @since 1.0.0
 */
@Controller
@RequestMapping("file")
public class FileController {

    //头像上传
    @RequestMapping("uploadFiles")
    @ResponseBody
    public Map<String,String> uploadFiles(MultipartFile img, HttpServletRequest request){
        String fileUpload = FileUtil.FileUpload(img, request);
        Map<String,String> map = new HashMap<String,String>();
        map.put("img", fileUpload);
        return map;
    }

}